package 笔试.拼多多;

import java.util.Arrays;
import java.util.Scanner;

/**
 * 存在覆盖数组，输出true，否则输出false
 */
public class PinDuoDuoDemo01 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        boolean flag = false;
        int[][] nums = new int[n][2];
        for(int i=0;i<n;i++){
            nums[i][0] = in.nextInt();
            nums[i][1] = in.nextInt();
        }
        Arrays.sort(nums,(a,b)->a[0]-b[0]);
        int preR = nums[0][1];
        for(int i=1;i<n;i++){
            if(nums[i][1]<=preR){
                flag = true;
            }
            preR = nums[i][1];
        }
        if(flag){
            System.out.println(true);
        }else{
            System.out.println(false);
        }
    }
}
